﻿using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.Hr;
using HengTong.Model.Db.Hr.Bill;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.Person.SysPersonResumeVms
{
    public partial class SysPersonResumeTemplateVm : BaseTemplateVM
    {
        [Display(Name = "员工")]
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.PersonId);
        [Display(Name = "调岗申请ID")]
        public ExcelPropety TransferRequestExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.TransferRequestId);
        [Display(Name = "履历类型")]
        public ExcelPropety ResumeTypeExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.ResumeType);
        [Display(Name = "起始日期")]
        public ExcelPropety StartDateExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.StartDate);
        [Display(Name = "结束日期")]
        public ExcelPropety EndDateExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.EndDate);
        [Display(Name = "原部门")]
        public ExcelPropety OriginalGroupExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalGroupId);
        [Display(Name = "原岗位")]
        public ExcelPropety OriginalPositionExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalPositionId);
        [Display(Name = "原职级")]
        public ExcelPropety OriginalRankExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalRank);
        [Display(Name = "原基本薪资")]
        public ExcelPropety OriginalBaseSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalBaseSalary);
        [Display(Name = "原岗位薪资")]
        public ExcelPropety OriginalPositionSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalPositionSalary);
        [Display(Name = "原绩效薪资")]
        public ExcelPropety OriginalPerformanceSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.OriginalPerformanceSalary);
        [Display(Name = "新部门")]
        public ExcelPropety NewGroupExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewGroupId);
        [Display(Name = "新岗位")]
        public ExcelPropety NewPositionExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewPositionId);
        [Display(Name = "新职级")]
        public ExcelPropety NewRankExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewRank);
        [Display(Name = "新基本薪资")]
        public ExcelPropety NewBaseSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewBaseSalary);
        [Display(Name = "新岗位薪资")]
        public ExcelPropety NewPositionSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewPositionSalary);
        [Display(Name = "新绩效薪资")]
        public ExcelPropety NewPerformanceSalaryExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.NewPerformanceSalary);
        [Display(Name = "调整原因")]
        public ExcelPropety TransferReasonExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.TransferReason);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysPersonResume>(x => x.Remark);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
            TransferRequestExcel.DataType = ColumnDataType.ComboBox;
            TransferRequestExcel.ListItems = DC.Set<SysHrTransferRequestBill>().GetSelectListItems(Wtm, y => y.Approver);
            OriginalGroupExcel.DataType = ColumnDataType.ComboBox;
            OriginalGroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.GroupName);
            OriginalPositionExcel.DataType = ColumnDataType.ComboBox;
            OriginalPositionExcel.ListItems = DC.Set<SysJobPosition>().GetSelectListItems(Wtm, y => y.Name);
            NewGroupExcel.DataType = ColumnDataType.ComboBox;
            NewGroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.GroupName);
            NewPositionExcel.DataType = ColumnDataType.ComboBox;
            NewPositionExcel.ListItems = DC.Set<SysJobPosition>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysPersonResumeImportVm : BaseImportVM<SysPersonResumeTemplateVm, SysPersonResume>
    {

    }

}
